﻿using System;
using System.Collections.Generic;
using System.Text;
using Prism.Mvvm;
using Prism.Events;


namespace DataDefine
{

    [Serializable]
    public class DeviceInfo : BindableBase
    {
        private string _DeviceName = "";
        public string DeviceName
        {
            get { return _DeviceName; }
            set { SetProperty(ref _DeviceName, value); }
        }

        private string _DeviceType = "";
        public string DeviceType
        {
            get { return _DeviceType; }
            set { SetProperty(ref _DeviceType, value); }
        }

        private string _HWVersion = "";
        public string HWVersion
        {
            get { return _HWVersion; }
            set { SetProperty(ref _HWVersion, value); }
        }

        private string _HWNumber = "";
        public string HWNumber
        {
            get { return _HWNumber; }
            set { SetProperty(ref _HWNumber, value); }
        }

        private string _SWAppVersion = "";
        public string SWAppVersion
        {
            get { return _SWAppVersion; }
            set { SetProperty(ref _SWAppVersion, value); }
        }

        private string _SWBootloaderVersion = "";
        public string SWBootloaderVersion
        {
            get { return _SWBootloaderVersion; }
            set { SetProperty(ref _SWBootloaderVersion, value); }
        }

        private string _CANNode_ID = "";
        public string CANNode_ID
        {
            get { return _CANNode_ID; }
            set { SetProperty(ref _CANNode_ID, value); }
        }

        [NonSerialized]
        private Device _Parent;
        public Device Parent
        {
            get { return _Parent; }
            set { SetProperty(ref _Parent, value); }
        }
        public DeviceInfo()
        {

        }
    }

    [Serializable]
    public class ShippingInfo : BindableBase
    {
        private string _OrderNumber = "";
        /// <summary>
        /// 订单号
        /// </summary>
        public string OrderNumber
        {
            get { return _OrderNumber; }
            set { SetProperty(ref _OrderNumber, value); }
        }
        private DateTime _ShippingDate;
        public DateTime ShippingDate
        {
            get { return _ShippingDate; }
            set { SetProperty(ref _ShippingDate, value); }
        }
    }

    [Serializable]
    public class AdditInfo : BindableBase
    {
        private ShippingInfo _ShippingInfo;
        public ShippingInfo ShippingInfo
        {
            get { return _ShippingInfo; }
            set { SetProperty(ref _ShippingInfo, value); }
        }

        private string _Notes = "";
        public string Notes
        {
            get { return _Notes; }
            set { SetProperty(ref _Notes, value); }
        }
    }


    [Serializable]
    public class Device : BindableBase
    {
        private DeviceInfo _DeviceInfo;
        public DeviceInfo DeviceInfo
        {
            get { return _DeviceInfo; }
            set { SetProperty(ref _DeviceInfo, value); }
        }

        private AdditInfo _AdditionalInfo;
        public AdditInfo AdditionalInfo
        {
            get { return _AdditionalInfo; }
            set { SetProperty(ref _AdditionalInfo, value); }
        }

        private RunParameter[] _Parameters;
        public RunParameter[] Parameters
        {
            get { return _Parameters; }
            set { SetProperty(ref _Parameters, value); }
        }

        public Device()
        {
            DeviceInfo = new DeviceInfo();
            AdditionalInfo = new AdditInfo();
            Parameters = new RunParameter[1];
            Parameters[0] = new RunParameter();
            Parameters[0].ParameterName = "tmp_0";
            DeviceInfo.DeviceName = "tmp_Dev0";
            DeviceInfo.Parent = this;
            AdditionalInfo.ShippingInfo = new ShippingInfo();
            AdditionalInfo.Notes = "";
            AdditionalInfo.ShippingInfo.ShippingDate = DateTime.Now;
            AdditionalInfo.ShippingInfo.OrderNumber = "";
        }
    }

}
